/**
 * @author wn
 * @date 2023/12/26 10:17:44
 * @description: 收货地址 选定
 */

import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useAddressStore = defineStore('address', () => {
	// 选中收货地址
	const selectedAddress = ref<AddressItem>()

	// 修改会选中收货地址
	const changeSelectedAddress = (address: AddressItem) =>
		(selectedAddress.value = address)

	// 返回
	return { selectedAddress, changeSelectedAddress }
})
